package com.cn.qtms.entity;//类注释设置模板

import com.cn.qtms.base.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

/**
 * @Name:TmSecAct
 * @Description:
 * @Author: zhangyang
 * @Date: 2019-12-26 10:37
 **/
@Entity
@Table(name = "tm_sec_act")
@org.hibernate.annotations.Table(appliesTo = "tm_sec_act",comment="秒杀活动表")
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
public class TmSecAct  extends BaseEntity {

    @Column(name = "title",unique = true,columnDefinition = "varchar(50) COMMENT '标题'")
    private  String title;

    @Column(name = "start_date", columnDefinition = "date COMMENT '开始日期'")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startDate;

    @Column(name = "end_date", columnDefinition = "date COMMENT '结束日期'")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endDate;

    @Column(name = "detail", columnDefinition = "varchar(255) COMMENT '描述'")
    private String detail;

    @Column(name = "status", columnDefinition = "varchar(10) COMMENT '状态 0初始化 1上架 2下架'")
    private String status;
}
